package com.ymh.spring.springmvc.config;

import org.springframework.web.servlet.support.AbstractAnnotationConfigDispatcherServletInitializer;

import com.ymh.spring.springmvc.web.WebConfig;

public class SpittrWebAppInitializer extends
		AbstractAnnotationConfigDispatcherServletInitializer {

	/**
	 * 根配置 
	 * getRootConfigClasses()方法返回的带有@Configuration注解的类将会用来配置ContextLoaderListener创建的应用上下文中的bean
	 */
	@Override
	protected Class<?>[] getRootConfigClasses() {
		return new Class<?>[] { RootConfig.class };
	}

	/**
	 * DispatcherServlet的配置 
	 * 指定配置类
	 */
	@Override
	protected Class<?>[] getServletConfigClasses() {
		return new Class<?>[] { WebConfig.class };
	}

	/**
	 * 将DispatcherServlet映射到"/"
	 */
	@Override
	protected String[] getServletMappings() {
		return new String[] { "/" };
	}

}
